<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>建议墙</title>
</head>
<body>
	<sf:form method="post" modelAttribute="propose">
		<div class="input-group">
			<sf:textarea path="propose" class="form-control" rows="3"
				cssStyle="resize:none;" placeholder="留下您对网站的建议" />
			<sf:hidden path="user.id" value="${loginUser.id}"
				class="form-control" />
			<span class="input-group-btn"> <sf:button
					class="btn btn-info btn-lg">提点<br>建议</sf:button>
			</span>
		</div>
	</sf:form>
	${proposeCount }&nbsp;条建议
	<table>
		<ul class="list-group">
			<c:forEach items="${proposes }" var="propose">
				<li class="list-group-item">
					<div class="media">
						<div class="media-left media-middle">
							<a href="#"> <img class="media-object"
								id="${propose.user.id }" src="${propose.user.avatar }"
								alt="${propose.user.username }" height="50px" width="50px">
							</a>
						</div>
						<div class="media-body">
							<h4 class="media-heading" id="${propose.id }">${propose.user.username }</h4>
							${propose.propose }
						</div>
					</div>
				</li>
				<br>
			</c:forEach>
		</ul>
	</table>
	<nav class="pull-right">

					<ul class="pagination pagination-lg">
						<li><a
							href="./${url }?pageNo=${pageNo - 1}"
							aria-label="Previous"> <span aria-hidden="true">&laquo;</span>
						</a></li>
						<c:forEach begin="0" end="9" var="a">
							<c:set var="apageNo">
								<fmt:formatNumber type="number"
									value="${(pageNo - pageNo%10)/10 }" maxFractionDigits="0"
									pattern="#" />${a%10}
							</c:set>
							<c:if test="${apageNo != 0 }">
								<li <c:if test="${pageNo == apageNo }">class="active"</c:if>><a
									href="./${url }?pageNo=${apageNo}">${apageNo } </a></li>
							</c:if>
						</c:forEach>
						<li><a href="./${url }?pageNo=${pageNo + 1}"
							aria-label="Next"> <span aria-hidden="true">&raquo;</span>
						</a></li>
					</ul>
				</nav>
</body>
</html>